<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="job_edit" style="display: block;width: 750px">
    <p>添加求职偏好</p>
    <table>
        <tr>
            <td>
                <div class="layui-inline">
                    <label class="layui-form-label">期望行业</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="expectIndustry" placeholder="请填写"
                               value="${resume.resume.expectIndustry}">
                    </div>
                </div>
            </td>
            <td>
                <div class="layui-inline">
                    <label class="layui-form-label">期望职位</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="expectJob" placeholder="请填写"
                               value="${resume.resume.expectJob}">
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="layui-inline">
                    <label class="layui-form-label">期望城市</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="expectCity" placeholder="请填写"
                               value="${resume.resume.expectCity}">
                    </div>
                </div>
            </td>
            <td>
                <div class="layui-inline">
                    <label class="layui-form-label">期望薪资</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="salaryRequirement" placeholder="请填写"
                               value="${resume.resume.salaryRequirement}">
                    </div>
                </div>
            </td>
        </tr>
    </table>

    <button class="button_save" id="button_job_save">保存并更新</button>
    <button class="button_cancel" id="button_job_cancel">取消</button>
</div>
<script>
    $("#button_job_save").click(function () {
        let resumeId = $("#resumeId").val();
        //     // console.log($("#job_info"))
        //     $("#job_info").load("/hire/resume/job_info",{id:resumeId});
        //     $("#job_edit").hide();
        //     $("#job_info").show();
        // })
        //期望行业
        let expectIndustry = $("#expectIndustry").val();
        console.log(expectIndustry);
        //期望职位
        let expectJob = $("#expectJob").val();
        console.log(expectJob);
        //期望城市
        let expectCity = $("#expectCity").val();
        console.log(expectCity);
        //期望薪资
        let salaryRequirement = $("#salaryRequirement").val();
        console.log(salaryRequirement);
        let param = "id=" + resumeId + "&expectIndustry=" + expectIndustry + "&expectJob=" + expectJob
            + "&expectCity=" + expectCity + "&salaryRequirement=" + salaryRequirement;
        console.log(param);
        $.post("/hire/resume/job/update", param, function (res) {
            if (res.code == '200') {
                $("#job_info").load("/hire/resume/job_info", {id: resumeId});
                $("#job_edit").hide();
                $("#job_info").show();
            } else {
                layer.msg(res.msg);
            }
        })

    })
    $("#button_job_cancel").click(function () {
        let resumeId = $("#resumeId").val();
        // console.log($("#job_info"))
        $("#job_info").load("/hire/resume/job_info", {id: resumeId});
        $("#job_edit").hide();
        $("#job_info").show();
    })
</script>
